<template>
  <div class="flex-1 m-l-15">
    <el-table
        size="mini"
        highlight-current-row
        class="view-table"
        :data="tableData"
        border
        style="width: calc(100vw - 550px)">

        <el-table-column
          prop="createtime"
          align="center"
          label="创建时间">
            <template slot-scope="scope">
              <div  class=" fz-14 C_333">{{ moment.unix(scope.row.createtime).format('YYYY-MM-DD HH:mm:ss')}}</div>
            </template>
        </el-table-column>

        <el-table-column
        prop="CJnUM"
        align="center"
        label="出金">
        </el-table-column>


        <el-table-column
        prop="RJnUM"
        align="center"
        label="入金">
        </el-table-column>

    </el-table>
  </div>
</template>

<script>
import { mapState } from 'vuex';
import moment from 'moment'
export default {
  props: ['date'],
  components: {
    
  },
  computed: mapState({
    select: state => state.trade.select /* 当前选中股指 */,
    symbol: state => state.trade.symbol /* 全部行情 */,
    symbos: state => state.trade.symbos /* 当前页面显示杨青 */,
    ticket: state => state.trade.ticket /* 推送数据 */,
    optionlist: state => state.trade.optionlist /* 全部合约代码 */
  }),
  watch: {
    ticket:{
　　　　handler: function(val) {
        
　　　　},
      immediate: true,
　　　 deep:true
　　},
  },
  data() {
    return {
      moment: moment,
      selectItem: {},
      tableData: []
    };
  },
  created: function() {
    this.getList();
  },
  methods: {
    getList() {
        let startday = this.date[0]
       let endday = this.date[1]
       this.$get('/funds/settle', {startday:startday, endday: endday }).then(res => {
         res.data.map( item => {
           item.RJnUM = item.addtype == 'rj' ? item.rate + item.addnum : 0
           item.CJnUM = item.addtype == 'cj' ? item.rate + item.addnum : 0
           return item
         })
         this.tableData = res.data
       })
    }
  }
};
</script>

<style scoped lang="less">
</style>
